<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        canvas{
            width: 500px;
            height: 500px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <canvas></canvas>
</body>
<script>
    var ctx = document.querySelector('canvas')
    ctx = ctx.getContext('2d')
    ctx.beginPath()
    ctx.moveTo(100,100)
    ctx.lineTo(200,200)
    ctx.lineTo(100,200)
    ctx.lineTo(100,100)
    ctx.stroke()
    ctx.fill()
</script>
</html>